package com.zhousb.deviceManager.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zhousb.deviceManager.common.PageRequest;
import com.zhousb.deviceManager.common.R;
import com.zhousb.deviceManager.common.ResponseResult;
import com.zhousb.deviceManager.model.bo.AssetOutBo;
import com.zhousb.deviceManager.model.so.OutboundPageSo;
import com.zhousb.deviceManager.service.OutboundDeliveryService;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/outbound")
public class OutboundDeliveryController {
@Resource
    OutboundDeliveryService outboundDeliveryService;
    @PostMapping("/submit")
    public ResponseResult outStorage(@RequestBody AssetOutBo bo)  {
        return R.success(outboundDeliveryService.outStorage(bo));
    }

    @PostMapping("/page")
    public ResponseResult page(@RequestBody PageRequest<OutboundPageSo> so)  {
        return R.success(outboundDeliveryService.page(new Page<>(so.getCurrent(),so.getSize()),so.getQuery()));
    }

}
